<template>
	<view class="content">
		<NavHeader style="width: 100%;" :title="title"></NavHeader>
		<card-box style="width: 100%;" :header="'全市民意处理情况'">
			<view slot="main" class="content-card-main">
				<view class="main_card main_card_b">
					<view class="card" v-for="(item,index) in card4ImgList" :key="index">
						<image :src="item.url"></image>
						<view class="title" style="left:40rpx;color: #363636;">
							{{item.title}}
						</view>
						<view class="bottom" :style="`left:40rpx;color: ${item.unitColor};`">
							<text :style="`color: ${item.color};`">
								{{item.number}}
							</text>
							{{item.unit}}
						</view>
					</view>
				</view>
			</view>
		</card-box>
		<card-box style="width: 100%;" :header="'民意处理情况详情'">
			<view slot="main" class="content-card-main">
				<c-table :headerData="headerData" :tableData="tableData">
					<template v-slot:unitName="{data}">
						<view class="font unitName">
							{{data.unitName}}
						</view>
					</template>
					<template v-slot:controls="{data}">
						<view class="font controls" @click="lookView">
							{{data.controls}}
						</view>
					</template>
				</c-table>
				<view class="table_footer">
					展开 <text class="triangle"></text>
				</view>

			</view>
		</card-box>
		<card-box style="width: 100%;" :header="'本周全市民意反映情况'">
			<view slot="main" class="content-card-main">
				<BarChart />
			</view>
		</card-box>
		<card-box style="width: 100%;" :header="'民意解决方式分布'">
			<view slot="main" class="content-card-main">
				<pieChart />
			</view>
		</card-box>
		<card-box style="width: 100%;margin-bottom: 30rpx;" :header="'民意关键词热度'">
			<view slot="main" class="content-card-main">
				<wordCloud :data="wordCloud">
				</wordCloud>
			</view>
		</card-box>
	</view>
</template>

<script>
	import NavHeader from '@/components/nacigation/NavHeader.vue';
	import cardbox from '@/components/card/cardbox.vue'
	import cTable from '@/components/cTable/cTable.vue'
	import wordCloud from '@/components/wordCloud.vue'
	import BarChart from './charts/bar-chart.vue'
	import pieChart from './charts/pie-chart.vue'
	
	export default {
		components: {
			NavHeader,
			wordCloud,
			BarChart,
			pieChart,
			"card-box": cardbox,
			"c-table": cTable
		},
		data() {
			return {
				header: "统计信息",
				title: '民意收集情况工作视窗',
				headerData: [{
						width: 30,
						align: 'left',
						name: '群众反映主题',
						value: 'unitName',
						solt: 'unitName'
					},
					{
						width: 20,
						align: 'left',
						name: '操作',
						value: 'controls',
						solt: 'controls'
					},

				],
				tableData: [{
						unitName: '张三领衔提出“关于增加养老福利的建议',
						controls: '查看详情'
					},
					{
						unitName: '张三领衔提出“关于增加养老福利的建议...张三领衔提出“关于增加养老福利的建议...',
						controls: '查看详情'
					},
				],


				card4ImgList: [{
						url: '/static/ct35r2r.png',
						title: '累计民意收集数',
						number: 1937,
						unit: '',
						color: '#B74B13',
						unitColor: "#DA8254"
					},
					{
						url: '/static/ct35r1r.png',
						title: '累计办结民意数',
						number: 16,
						unit: '',
						color: '#21B626',
						unitColor: "#21B626"
					},
					{
						url: '/static/ct35r3r.png',
						title: '平均办理周期',
						number: 7,
						unit: '天',
						color: '#A57504',
						unitColor: "#A57504"
					},

					{
						url: '/static/ct35r4r.png',
						title: '办结率',
						number: 99.60,
						unit: '%',
						color: '#F17666',
						unitColor: " #F17666"
					}
				],
				// 词云图数据
				wordCloud: [{
						name: "城建环资类(75)",
						value: 75,
					},
					{
						name: "法制类(4)",
						value: 4,
					},
					{
						name: "其他类(4)",
						value: 4,
					},
					{
						name: "预算类(32)",
						value: 32,
					},
					{
						name: "农村农业类(2)",
						value: 2,
					},
					{
						name: "社会建设类(35)",
						value: 35,
					},
					{
						name: "监察司法类(75)",
						value: 75,
					},
					{
						name: "经济类(4)",
						value: 4,
					},
					{
						name: "预算类(35)",
						value: 35,
					},
					{
						name: "经济类(2)",
						value: 2,
					},
					{
						name: "教科文卫类(2)",
						value: 2,
					},
					{
						name: "体育类(4)",
						value: 4,
					},
					{
						name: "经济类(32)",
						value: 32,
					},
					{
						name: "经济类(55)",
						value: 55,
					},
					{
						name: "监察司法类(55)",
						value: 55,
					},
					{
						name: "城建环资类(75)",
						value: 75,
					},
					{
						name: "教课文卫类(92)",
						value: 92,
					},
					{
						name: "其他类(35)",
						value: 35,
					},
					{
						name: "侨务类(4)",
						value: 4,
					},
				],
				barStyle: {
					color: '#F22C1F',
					background: 'linear-gradient(311deg, #FF1010 0%, #FFD3D3 100%);'

				},

			}
		},
		onLoad() {

		},
		methods: {

		}
	}
</script>

<style scoped>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		background: #F6F6F6;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}

	.content-card-main {
		padding: 26rpx 32rpx 32rpx 28rpx;
	}

	.content-card-main .main_card {
		display: flex;
		flex-direction: row;
		justify-content: space-between;
	}

	.content-card-main .main_card_b {
		display: flex;
		flex-wrap: wrap;
	}

	.content-card-main .main_card .card {
		position: relative;
	}


	.content-card-main .main_card_b .card {
		flex: 0 0 auto;
		/* 或者根据需要设置具体的宽度 */
		position: relative;
	}

	.content-card-main .main_card .card .title {
		position: absolute;
		top: 26rpx;
		left: 28rpx;
		font-family: PingFang SC, PingFang SC;
		font-weight: 500;
		font-size: 24rpx;
		color: #7F7F7F;
		line-height: 28rpx;
		text-align: left;
		font-style: normal;
		text-transform: none;
	}

	.content-card-main .main_card .card .bottom {
		position: absolute;
		top: 72rpx;
		left: 28rpx;
		font-family: PingFang SC, PingFang SC;
		font-weight: 500;
		font-size: 24rpx;
		color: #7F7F7F;
		line-height: 28rpx;
		text-align: left;
		font-style: normal;
		text-transform: none;
	}

	.content-card-main .main_card .card .bottom text {
		font-family: PingFang SC, PingFang SC;
		font-weight: 500;
		font-size: 40rpx;
		color: #000000;
		line-height: 47rpx;
		text-align: left;
		font-style: normal;
		text-transform: none;
	}

	.content-card-main .main_card .card image {
		width: 204rpx;
		height: 148rpx;
	}

	.content-card-main .main_card_b .card image {
		width: 308rpx;
		height: 160rpx;
	}


	.font {
		font-family: PingFang SC, PingFang SC;
		font-weight: 500;
		font-size: 24rpx;
		font-style: normal;
		text-transform: none;
	}

	.unitName {
		width: 362rpx;
		color: #000000;
		overflow: hidden;
		text-overflow: ellipsis;
		/* 超出部分显示为省略号 */
		white-space: nowrap;
		/* 保持内容在一行显示，如果需要多行，可以移除这行 */
	}

	.controls {
		width: 100rpx;
		color: #2A8BFD;
	}

	.table_footer {
		margin-top: 26rpx;
		text-align: center;
		width: 100%;
		font-family: PingFang SC, PingFang SC;
		font-weight: 500;
		font-size: 24rpx;
		color: #2A8BFD;
		line-height: 28rpx;
		font-style: normal;
		text-transform: none;
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: center;
	}

	.triangle {
		margin-left: 6rpx;
		width: 0;
		height: 0;
		border-left: 9rpx solid transparent;
		/* 左侧透明 */
		border-right: 9rpx solid transparent;
		/* 右侧透明 */
		border-top: 12rpx solid #2A8BFD;
		/* 上侧为实心颜色 */
	}

	.wordCloud-warp_main {
		/* 	width: 652rpx;
		height: 384rpx; */
		background: #FFFFFF;
		border-radius: 8rpx 8rpx 8rpx 8rpx;
		border: 2rpx solid #E8E8E8;
	}
</style>